package com.lwj.liwanjia.view.activity.login;


import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;

import com.lwj.liwanjia.MainActivity;
import com.lwj.liwanjia.R;
import com.lwj.liwanjia.base.BaseActivity;
import com.lwj.liwanjia.utils.SpfUtils;

import butterknife.BindView;

public class WelcomeActivity extends BaseActivity {

    @BindView(R.id.iv_welcome)
    ImageView ivWelcome;

    @Override
    protected void initView() {
        boolean firstOpen = SpfUtils.getSpfUtils(this).getFirstOpen();
        if (firstOpen) {//第一次
            ivWelcome.postDelayed(new Runnable() {
                @Override
                public void run() {
                    startActivity(new Intent(WelcomeActivity.this, GuideActivity.class));
                    finish();
                    SpfUtils.getSpfUtils(WelcomeActivity.this).FirstOpen(false);
                }
            }, 2000);
        }else{
            ivWelcome.postDelayed(new Runnable() {
                @Override
                public void run() {
                    startActivity(new Intent(WelcomeActivity.this,MainActivity.class));
                    finish();
                }
            }, 2000);
        }

    }

    @Override
    protected void initData() {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_welcome;
    }

}
